CC = gcc
CFLAGS = -w -O2
BIN = xping
SRC = xping.c
INSTALLDIR = /usr/local/sbin

all:
	$(CC) $(SRC) -o $(BIN) $(CFLAGS) 

win:
	$(CC) $(SRC) -o $(BIN).exe $(CFLAGS) -lws2_32

install:
	@make all
	@cp -f $(BIN) $(INSTALLDIR)
	@chmod +x $(INSTALLDIR)/$(BIN)
	@echo install success in $(INSTALLDIR)/$(BIN)

clean:
	rm -f *.o $(BIN) $(BIN).exe

uninstall:
	rm -f $(INSTALLDIR)/$(BIN)
	@echo uninstall success


help:
	@echo A Simple Free TCP/IP Packet Test
	@echo using \"make\" to make binary in linux
	@echo using \"make win\" to make in windows\(mingw\)
	@echo using \"make clean\" to clean binary
	@echo using \"make install\" to install in $(INSTALLDIR)
	@echo using \"make uninstall\" to uninstall
